﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="add.aspx.cs" Inherits="Import_bbs_add" EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" language="javascript"></script>
    <script>

        $(document).ready(function () {
            $("#ddlNewType1").change(function () {
                var pid = $(this).val();
                if (pid == "") {
                    $("#ddlNewType2").html("");
                }
                else {
                    $("#ddlNewType2").html("");
                    $.getJSON("../../news/NewsTypeHandler.ashx", { pid: pid }, function (data) {
                        var html = "";
                        $.each(data, function (i) {
                            html += " <option value='" + data[i].id + "'>" + data[i].name + "</option>";
                        })
                        $("#ddlNewType2").html(html);
                    })
                }
            })
        })
    </script>
    <style type="text/css">
        .style1
        {
            height: 23px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
          <table class="query_form_table">
              <tr>
                 <th>本地类型</th>
                 <td>
                       <asp:DropDownList ID="ddlNewType1" runat="server">
                       </asp:DropDownList>
                        <asp:DropDownList ID="ddlNewType2" runat="server">
                        </asp:DropDownList>
                       <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                           ControlToValidate="ddlNewType2" Display="Dynamic" ErrorMessage="非空" 
                           ForeColor="Red"></asp:RequiredFieldValidator>
                 </td>
              </tr>
              <tr>
                 <th>
                    论坛名称
                 </th>
                 <td>
                    <asp:TextBox ID="txtBBSName" runat="server" />
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                         ControlToValidate="txtBBSName" Display="Dynamic" ErrorMessage="非空" 
                         ForeColor="Red"></asp:RequiredFieldValidator>
                 </td>
              </tr>
              <tr>
                <th>
                    论坛编号
                </th>
                <td>
                    <asp:TextBox ID="txtBBSId" runat="server" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txtBBSId" Display="Dynamic" ErrorMessage="非空" 
                        ForeColor="Red"></asp:RequiredFieldValidator>
                </td>
              </tr>
              <tr>
                <td colspan="2" class="style1">
                    <asp:Button ID="btnSave" runat="server" Text ="保存" onclick="btnSave_Click" />                
                </td>
              </tr>
          </table>
    </div>
    </form>
</body>
</html>
